import java.util.*;

public class Main {

    public static void main(String args[]) {
        Scanner scanner = new Scanner(System.in);
        String children = scanner.nextLine();
        String[] c = children.split(" ");
        int[] g = new int[c.length];
        for(int i=0;i<c.length;i++)
            g[i] = Integer.parseInt(c[i]);

        String candy = scanner.nextLine();
        String[] ca = candy.split(" ");
        int[] s = new int[ca.length];
        for(int i=0;i<ca.length;i++)
            s[i] = Integer.parseInt(ca[i]);

        Arrays.sort(g);
        Arrays.sort(s);
        int count = 0;
        int pg = g.length-1, ps = s.length-1;
        while(pg>=0){
            if(g[pg]> s[ps])
                pg--;
            else{
                pg --;
                ps --;
                count++;
            }
        }
        System.out.println(count);
    }
}
